package br.com.format;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

public class FormataData {

	public static void main(String[] args) {
		Date d = new Date();
		
		DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
		
		System.out.println(df.format(d));
		System.out.println(d.getTime());
		
		d.setTime(1000*60*60*24 + d.getTime());
		
		System.out.println(df.format(d));
		System.out.println(d.getTime());
		
		try{
			System.out.println(df.parse("01/01/2011"));
		}catch(ParseException p){
			
		}
		
		Calendar c = Calendar.getInstance();
		c.set(2011,12,31);
		System.out.println(c.getTime());
	}

}
